@import './variables';
@import './sprite.scss';


*{
    outline: none;
    box-sizing: border-box;
}
html{
    font-size: 13px;
}
body{
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    line-height: 1.2em;
    background: #f1f1f1;
    -webkit-font-smoothing:antialiased;
}
a{
    color: #999;
}
.icon{
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}

@each $colorKey,$color in $colors {
    .text-#{$colorKey}{
        color: $color;
    }
    .bg-#{$colorKey}{
        background-color: $color;
    }
};

//text 
@each $var in (left,center,right) {
    .text-#{$var}{
        text-align: $var!important;
    }
}


//循环定义对应的字体大小工具类
@each $Key,$var in $font-sizes {
    .fs-#{$Key}{
        font-size:$var*$base-font-size ;
    }  
}
.text-ellipsis{
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



//flex布局
.d-flex{
    display: flex;
}

.flex-column{
    flex-direction: column;
}


@each $Key,$var in $jc{
    .jc-#{$Key}{
        justify-content: $var;
    }
}
@each $Key,$var in $ai{
    .ai-#{$Key}{
        align-items: $var;
    }
}

.flex-1{
    flex: 1;
}
.flex-wrap{
    flex-wrap: wrap;
}

.w-100{
    width: 100vw;
}
.h-100{
    height: 100vh;
}
// 遍历形成边距工具类 
@each $typeKey,$type in $space-type {
    @each $sizeKey,$size in $space-sizes {
        //m-1 => margin:0.25rem
        .#{$typeKey}-#{$sizeKey}{
            #{$type}:$size*$space-base-size;
        }
        // mx-1 => margin-left:0.25rem;margin-right:0.25rem
        .#{$typeKey}x-#{$sizeKey}{
            #{$type}-left:$size*$space-base-size;
            #{$type}-right:$size*$space-base-size;
        }
        .#{$typeKey}y-#{$sizeKey}{
            #{$type}-top:$size*$space-base-size;
            #{$type}-bottom:$size*$space-base-size;
        }
    }
    // .mt-1 => margin-top:0.25rem
    @each $direKey,$dire in $space-direction {
        @each $sizeKey,$size in $space-sizes {
            .#{$typeKey}#{$direKey}-#{$sizeKey}{
                #{$type}-#{$dire}:$size*$space-base-size;
            }
        }
    }
};

.btn{
    border: none;
    border-radius: 0.1538rem;
}

.nav{
    display: flex;
    align-items: center;
    .nav-item{
        border-bottom: 3px solid transparent;
        &.active{
            color: map-get($colors, 'primary');
            border-bottom-color:map-get($colors, 'primary');
        }
    }
    &.nav-inverse{
        .nav-item{
            color: map-get($colors, 'white');
            &.active{
                border-bottom-color:map-get($colors, 'white');
            }
        }
    }
}
.tips{
    color: map-get($colors, 'dark');
    font-size: map-get($font-sizes,'xs-1')*$base-font-size;
    line-height: 160%;
}

